package com.voodoo.lib_wechatpayface;

import java.util.HashMap;
import java.util.Map;

/**
 * Author：voodoo
 * CreateTime：2021/09/26 026 下午 15:07:08
 * Description：服务器返回的数据主要是凭证商户号等
 */
public class ResultDataBean {

    /**
     * expires_in : 3600
     * nonce_str : HvKUriIMeeFWDaZs8pmm3FMO5MKqjGAz
     * sign : 11F6B8F3AE835CDA17BE9D614AA943BD
     * appid : wxb7e8e46fed4a8555
     * mch_id : 1608093077
     * sub_appid : null
     * sub_mch_id : null
     * return_code : SUCCESS
     * return_msg : 请求成功
     * authinfo : Q/rPxJs+hHVqz2XcWMROKWiUWFYSOd2MxRtJBrPzZg3S3yPBBSLBbU3zjNrysfoFstDMEeVyNPxT+8fYOLdM+hreR+0Zo3y6rRDVhyTxeD1DmAO47wEU6Ire3Kma93vyNQQRVrBXbwamdeUNUznYZphtcEO96epyzBdrB4ZujmBk7eor6fQdUrL+WEMYarI3TkXsF7/NdZmuA9swCWvnds/nVulxiCwDeqNZuMYdb+YN9S6TsXrucn0gFNNMpV3Ci6zrIHMc+NQthP2hwE5pfwaENKV5m2Ka80SU4HrlAh5EqxzbpcFNsO9BDY3AcTz/T7YwZf1H3PtDTkzFJGEoLTjnnUuDVHh9q7q09L7KomZdJt8bjOSFO/qZ+KJeRPU1kfmZQF2eob5ryvjq7vlcmctMR8+RmoM4TGxVPb9HYSn6q9WRcRfrCj309FeoC3I977r7DHvAyC9WAkLWP7WC5kk4L+Jein16rkQ/nYRTAauI16RR9/Ph0oKsK852pyrXmNl9CrnqGe0u5RIXUWZPyYhdfYKAzXy2B1Y9lELlSimVcucWvRInRox0HE4pNOPE9NB/JI5cctBt+yxAV7cDSmC1YTS5ylyREhZuanjmeOTc9F6OhyS2uPwyC2/SR3p+romfah0BymiEBRZhIv574n0faHWgBWyh4Dg10HcyDKm0dk0HNHsEEjiaGR75bvYUKAnUvZoi5obC+0msILy3aRX/d0u+ao2zpHzPfIgynwRiplGCkp2E7udLg18rrr4jKnpbzACIU9J1Wb5TJ5zVozW3VuR/1LOH/ndAKF1XujS1gwdMt+ExdeIUKUc12x4AfTZ5J63jjNBQwWoEkJ/M4+jN0FVZ27swzREyapve3NjKr+aVQ13eUZO8QTOlhmX6ED/pv88NtlG2XiFaeIhELs7ojy21w71vPzrZqYty+4rGvLEWEqdmvThY5WVb1QdSJgmOF9/KMCWzBnvhnpDlIaP8e4bgKFKqXH+0CJ2EloHutDOjNUCaxzlf/Q3l3dx6nuuWYhfPkXp8EnvcnYeo70i8kD2E+lauiax3JlpV62/LjF5/UNOJXp4JYN3zPfA+DGMNyBKEwMNX/y56ns1Zwls9rhNRIfTKzouqtKTgYWXwSY3wbuO+yi0nVRItnUKFQi0WS+VbPWcPZ88CXSnGun9xoVCS5/ryUVTKKIWtBKi3mvfnIpO71VIU5p5yqpIc/Ujt1y579CUWAONquXtExCYMC3ZCCIAhDXC4BbGT+iEzbJxybSMX3pV0
     */

    private int expires_in; // authinfo的有效时间, 单位秒
    private String nonce_str; // 随机字符串
    private String sign; // 响应结果签名
    private String appid; // 公众号
    private String mch_id; // 商户号
    private String sub_appid; // 子商户公众账号ID(服务商模式)
    private String sub_mch_id; // 子商户号(服务商模式)
    private String return_code; // 错误码
    private String return_msg; // 对错误码的描述
    private String authinfo; // SDK调用凭证

    public int getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(int expires_in) {
        this.expires_in = expires_in;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getSub_appid() {
        return sub_appid;
    }

    public void setSub_appid(String sub_appid) {
        this.sub_appid = sub_appid;
    }

    public String getSub_mch_id() {
        return sub_mch_id;
    }

    public void setSub_mch_id(String sub_mch_id) {
        this.sub_mch_id = sub_mch_id;
    }

    public String getReturn_code() {
        return return_code;
    }

    public void setReturn_code(String return_code) {
        this.return_code = return_code;
    }

    public String getReturn_msg() {
        return return_msg;
    }

    public void setReturn_msg(String return_msg) {
        this.return_msg = return_msg;
    }

    public String getAuthinfo() {
        return authinfo;
    }

    public void setAuthinfo(String authinfo) {
        this.authinfo = authinfo;
    }

    @Override
    public String toString() {
        return "DataBean{" +
                "有效时间=" + expires_in +
                "秒, 随机字符串='" + nonce_str + '\'' +
                ", 响应结果签名='" + sign + '\'' +
                ", 公众号='" + appid + '\'' +
                ", 商户号='" + mch_id + '\'' +
                ", 子商户公众账号ID(服务商模式)=" + sub_appid +
                ", 子商户号(服务商模式)=" + sub_mch_id +
                ", 错误码='" + return_code + '\'' +
                ", 误码的描述='" + return_msg + '\'' +
                ", SDK调用凭证='" + authinfo + '\'' +
                '}';
    }

    public Map<String, String> toMap() {
        Map<String, String> returnMap = new HashMap<>();
        returnMap.put("expires_in", String.valueOf(expires_in));
        returnMap.put("nonce_str", nonce_str);
        returnMap.put("sign", sign);
        returnMap.put("appid", appid);
        returnMap.put("mch_id", mch_id);
        returnMap.put("sub_appid", sub_appid);
        returnMap.put("sub_mch_id", sub_mch_id);
        returnMap.put("return_code", return_code);
        returnMap.put("return_msg", return_msg);
        returnMap.put("authinfo", authinfo);
        return returnMap;
    }

}
